package org.sakai.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Swagger3Config {
    /**
     * 给api进行分组，此为minio分组
     * @return
     */
    @Bean
    public GroupedOpenApi minioApi() {
        return GroupedOpenApi.builder()
                .group("minio-api")
                .pathsToMatch("/minio/**")
                .build();
    }
    /**
     * 给api进行分组，此为minio分组
     * @return
     */
    @Bean
    public GroupedOpenApi userApi() {
        return GroupedOpenApi.builder()
                .group("user-api")
                .pathsToMatch("/user/**")
                .build();
    }
    @Bean
    public OpenAPI springShopOpenAPI() {
        return new OpenAPI()
                .info(new Info().title("MyPlatform")
                .description("This a Platform belong to sakai")
                .version("v0.0.1")
                .license(new License().name("Apache 2.0")));
    }
}
